package com.gy.api.common.file.controller;

import com.github.pagehelper.PageInfo;
import com.gy.api.base.ApiIndex;
import com.gy.api.base.R;
import com.gy.api.common.file.domain.vo.FileVO;
import com.gy.api.common.file.service.IFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;




/**
 * @ClassName FileController
 * @Author HandsomeBugs
 * @Version 1.0
 **/

@Api(tags = ApiIndex.FileController)
@RequestMapping(value = "/file")
@RestController
public class FileController {

    @Autowired
    private IFileService service;

    @ApiOperation(value = "文件上传【本地存储】")
    @PostMapping(value = "/upload")
    @ResponseBody
    public R<FileVO> upload(
            @ApiParam(value = "文件", required = true) @RequestParam("file") MultipartFile file
    ) {
        return service.upload(file);
    }


}
